import { Rule, RuleType } from "@midwayjs/validate";
import { CertificateType, ProviderCertificateStatus } from "../entity/certificate";

export class AddCertificateDTO {
    @Rule(RuleType.string().valid(...Object.values(CertificateType)).required())
    type: CertificateType;

    @Rule(RuleType.string().required())
    number: string;

    @Rule(RuleType.array().items(RuleType.string()).required())
    photos: string[];

    @Rule(RuleType.object().required())
    data: any;

    @Rule(RuleType.string().optional().allow(''))
    remark: string;
}

export class AuditCertificateDTO {
    @Rule(RuleType.number().required())
    id: number;
    @Rule(RuleType.number().valid(ProviderCertificateStatus.PASSED, ProviderCertificateStatus.FAILED).required())
    status: ProviderCertificateStatus;
    @Rule(RuleType.string().optional().allow(''))
    rejectReason?: string;
}
